package main

import (
	"encoding/json"
	"fmt"
)

type Sub struct {
	Company string `json:"com"`
	Isok    bool
}

type Sub2 struct {
	I string `json:"com"` // 必须大写才能对应上
}

func main() {
	res, _ := json.Marshal(Sub{"AA", false})
	res2 := string(res)
	fmt.Println(res2) // {"com":"AA","Isok":false}
	var res3 Sub2
	json.Unmarshal([]byte(res2), &res3)
	fmt.Printf("%+v", res3) // {I:AA}
}
